<?php

namespace app\common\model\contract;

use app\common\model\BaseModel;
use app\common\model\bill\BillCateModel;
use app\common\model\room\RoomBasicModel;
use app\common\model\property\basic\PropertyBasicModel;

class ContractBillModel extends BaseModel
{

    public static function tablePk(): ?string
    {
        return "id";
    }

    public static function tableName(): string
    {
        return "contract_bill";
    }

    public function cateInfo()
    {
        return $this->hasOne(BillCateModel::class, 'id', 'cate_id');
    }

    public function propertyInfo()
    {
        return $this->hasOne(PropertyBasicModel::class, 'id', 'property_id');
    }

    public function roomInfo()
    {
        return $this->hasOne(RoomBasicModel::class, 'id', 'room_id');
    }

}